package stu.day25_day32.day25.all;

public class LeetCode104 {
    public int maxDepth(TreeNode root) {

        if(root == null){
            return 0;
        }
        if(root.left==null && root.right==null){
            return 1;
        }
        int l = maxDepth(root.left);
        int r = maxDepth(root.right);

        int h = Math.max(l,r);

        return h+1;

    }
}
